home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr48 / pasclern.zip / BOOLMATH.PAS < prev    next >
Pascal/Delphi Source File  |  1993-04-01  |  1KB  |  28 lines

  1. PROGRAM illustrate_what_boolean_math_looks_like;
  2.  
  3.    (* notice the program name, it can be up to 127 characters long
  4.       just so it fits on one line. Variables can also be very long
  5.       as we will see below *)
  6.  
  7. VAR a,b,c,d : BOOLEAN;
  8.     a_very_big_boolean_name_can_be_used : BOOLEAN;
  9.     junk,who : integer;
  10.  
  11. BEGIN
  12.   junk := 4;
  13.   who := 5;
  14.   a := junk = who;    {since junk is not equal to who, a is false}
  15.   b := junk = (who - 1);  {This is true}
  16.   c := junk < who;        {This is true}
  17.   d := Junk > 10;         {This is false}
  18.   a_very_big_boolean_name_can_be_used := a OR b; {Since b is true,
  19.                                                  the result is true}
  20.   WRITELN('result a is ',a);
  21.   WRITELN('result b is ',b);
  22.   WRITELN('result c is ',c);
  23.   WRITELN('result d is ',d:12); {This answer will be right justified
  24.                                  in a 12 character field}
  25.   WRITELN('result a_very_big_boolean_name_can_be_used is ',
  26.                   a_very_big_boolean_name_can_be_used);
  27. END.
  28.